import React, { Component } from 'react';
import {Link} from 'react-router-dom';

export default class List extends Component {
	constructor(){
		super();
		this.state={
			user:[
				{
					id:0,
					name: "kimoo",
					gender: "male"
				},
				{
					id:1,
					name: "momo",
					gender: "female"
				},
				{
					id:2,
					name: "zm",
					gender: "male"
				}
			]
		}
	}
  render() {
		return (
			<div>
				<h3>List</h3>
				<hr /> 
				<ul>
					{
						this.state.user.map(item=>(
							<li key={item.id}>
								<Link to={"/detail/"+item.id}>{item.name}</Link>
							</li>
						))
					}
				</ul>
			</div>
		)
  }
}

